<template>
    <div class="fixed-top">
      <div class="top">
        <router-link to="/">
          <i class="el-icon-arrow-left top-content"></i>
        </router-link>
        <div class="top-content">
          垃圾分类知识
        </div>
      </div>
      <div class="menu">
        <div class="menu-main">
          <div class="menu-text" @click="chooseClick('/home/recycled')" :class="{active: $route.path==='/home/recycled'}">可回收垃圾</div>
          <div class="menu-text" @click="chooseClick('/home/foodWaste')" :class="{active: $route.path==='/home/foodWaste'}">厨余垃圾</div>
          <div class="menu-text" @click="chooseClick('/home/harmful')" :class="{active: $route.path==='/home/harmful'}">有害垃圾</div>
          <div class="menu-text" @click="chooseClick('/home/other')" :class="{active: $route.path==='/home/other'}">其它垃圾</div>
        </div>
     </div>
    </div>
</template>

<script>
export default {
  name: 'OrderTop',
  data () {
    return {

    }
  },
  methods: {
    chooseClick (tag) {
      this.$router.push(tag)
      console.log(tag)
    }
  }
}
</script>

<style lang="scss" scoped>
@import "../../assets/styles/global";
  .fixed-top {
    height: 75px;
    .top{
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: 45px;
      line-height: 45px;
      background: skyblue;
      .top-content{
        float: left;
        margin-left: 5px;
      }
      .el-icon-arrow-left{
        font-size: 18px;
        margin-top: 1px;
      }
    }
    .menu {
      position: fixed;
      top: 45px;
      left: 0;
      right: 0;
      width: 100%;
      .menu-main {
        height: 30px;
        line-height: 30px;
        background: #fff;
        position: relative;
        .menu-text {
          float: left;
          width: 25%;
          text-align: center;
          font-size: 10px;
        }
      }
    }
  }
  .active{
    background: skyblue;
  }
</style>
